home *** CD-ROM | disk | FTP | other *** search
- Q33100 No Errors or Warnings for Erroneous sizeof Statement
- C Compiler
- 5.00 5.10 | 5.10
- MS-DOS | OS/2
-
- Summary:
- The compiler fails to generate any warning or error messages
- for the following erroneous statement:
-
- i = sizeof (int) 100; /* 'i' is an int */
-
- The sizeof operator is expecting either a type name or an
- expression; however, in this case, the operator is given neither
- because "(int) 100" is not a legal C expression. The compiler should
- generate a syntax error for this line.
- Microsoft has confirmed this to be a problem in C Versions 5.00 and
- 5.10. We are researching this problem and will post new information
- as it becomes available.
-
- More Information:
- The following are legal sizeof statements:
-
- i = sizeof (int); /* the size of a type name */
- i = sizeof 100; /* the size of a constant expression */
- i = sizeof ((int) 100); /* the extra parentheses are needed */
-
- For a precise definition of what the sizeof operator takes as
- arguments, and what constitutes a legal C expression, please refer to
- the Microsoft C Optimizing Compiler "Language Reference Manual," or
- the "The C Programming Language," by Kernighan and Ritchie, or to the
- Draft Proposed ANSI standard for C.
-
-
- Keywords: buglist5.00 buglist5.10
- Updated 88/07/29 12:16
-